import json
from config import BASE_DIR

# 封装读取json数据api代码
class read_jsondata(object):
    @classmethod
    def read(self,filename):
        with open(filename,encoding='utf-8') as f :
            data = json.load(f)
            list = []
        #     把[{},{}]转换成[(),()]
            for i in data:
                list.append(tuple(i.values()))
        return list





if __name__ == '__main__':
    filename = BASE_DIR + '/data/data_add.json'
    print(read_jsondata.read(filename))